import Cookies from 'js-cookie'

export const setToken = (tokenkey: string, token: string, cookieExpires: any) => {
    Cookies.set(tokenkey, token, { expires: cookieExpires || 1 })//如果不设置默认一小时过期
}

export const getToken: any = (tokenkey: string) => {
    const token = Cookies.get(tokenkey)
    if (token) return token
    else return false
}

export const delToken = (tokenkey: string) => {
    Cookies.remove(tokenkey)
}